<?php

/**
 * backend routes
 */
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('login', 'Auth\LoginController@login');

Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
Route::post('register', 'Auth\RegisterController@register');


Route::get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
Route::get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify');
Route::get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');

Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');

/**
 * auth:admin  config/auth里面配置
 */
Route::group(['middleware' => ['auth:backend']], function () {

    Route::post('logout', 'Auth\LoginController@logout')->name('logout');

    Route::get('index', 'IndexController@index')->name('index.index');
    Route::get('dashboard', 'IndexController@dashboard')->name('index.dashboard');
    /**
     * casbin 权限校验
     */
    Route::group(['middleware' => ["enforcer:backend"]], function () {


    });

    /**
     * 邮箱校验
     */
    Route::group(['middleware' => ["verified.email:backend"]], function () {

    });

    /**
     * 手机号码校验
     */
    Route::group(['middleware' => ["verified.phone:backend"]], function () {

    });
});